package it.uniroma2.structure;

public class ElseIf_Control extends Node{
	private ConditionControl condition;
	
	public ElseIf_Control(){
		this.condition = new ConditionControl();
	}
	
	
	public ElseIf_Control(ConditionControl cc){
		this.condition = cc;
	}
	
	
	@Override
	public String toBPEL() {
		String output = "<" + elseifTag + ">\n";
		output = output + this.condition.toBPEL();
		for(Node temp : this.subNodes) {
			output = output + temp.toBPEL();
		}
		return output + "</" + elseifTag + ">\n";
	}


	public Node generateSequence() {
		General_Sequence_Control genSeq = new General_Sequence_Control();
		String orderSeq = this.getOrderId() + "-1";
		genSeq.setOrderId(orderSeq);
		genSeq.setFather(this);
		this.subNodes.add(genSeq);
		return genSeq;
	}
}
